package com.learn.springboot3.controller;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: InformationController
 * Package: com.learn.springboot3.controller
 * Description:
 *
 * @Author jiangCheng
 * @Create 2024/10/15 17:11
 * @Version 1.0
 */
@RestController
@RequestMapping("/info")
public class InformationController {
    @GetMapping
    public String getInformation(HttpServletRequest request){
        String remoteAddr = request.getRemoteAddr();
        int remotePort = request.getRemotePort();
        return remoteAddr+remotePort;
    }
}
